﻿<div class="portlet light bordered">
    <div class="portlet-title">
        <div class="caption font-dark">
            <i class="fa fa-cog font-dark"></i>
            <span class="caption-subject bold">修改属性</span>
        </div>
    </div>
    <div class="portlet-body form">
        <form action="/attr/edit.do" class="form-horizontal" method="post">
            <div class="form-body">
            	<input type="hidden" name="attr.id" value="$!attr.id">
                <div class="row">
					<div class="col-md-6 form-group">
					    <label class="control-label col-md-4">*属性名称：</label>
					    <div class="col-md-6">
					        <input type="text" class="form-control" name="attr.name" value="$!attr.name" maxlength="20" required>
					    </div>
					</div>
                    <div class="col-md-6 form-group">
                        <label class="control-label col-md-4">属性备注：</label>
                        <div class="col-md-6">
                        	<input type="text" class="form-control" name="attr.meno" value="$!attr.meno" maxlength="20">
                        </div>
                    </div>
                </div>
            </div>
	        <div class="table-container table-scrollable">
	            <table class="table table-striped table-bordered table-hover" id="attrValueTable">
		            <thead>
		                <tr>
		                    <th> 属性值 </th>
		                    <th> 排序 </th>
		                    <th class="col-md-4"> 操作 </th>
		                </tr>
		            </thead>
		            <tbody>
		            	 #foreach($attrValue in $!listAttrValue)
		                 <tr>
		                     <td>
		                     	<input type="hidden" name="ids" value="$!attrValue.id">
		                     	<input type="text" class="form-control" name="attrValue.name" value="$!attrValue.name" maxlength="20" required>
		                     </td>
		                     <td>
							 	<input type="text" class="form-control integerNum" name="sort" value="$!attrValue.sort" >
							 </td>
		                     <td>
								<a class="btn green btn-outline btn-sm" onclick="addValue()">
									<i class="fa fa-plus"></i> 增加
								</a>
								<a class="btn green btn-outline btn-sm" data-attrValueId="$!attrValue.id" onclick="delValue(this)">
									<i class="fa fa-trash"></i> 删除
								</a>
		                     </td>
		                 </tr>
		                 #end
		            </tbody>
		        </table>
		    </div>
			<div class="form-actions right">
				<a href="javascript:;" thref="/attr/list?$!queryReturn" class="btn green ajax-post"> <i class="fa fa-check"></i> 提交</a> 
				<a href="javascript:;" data-dismiss="modal" class="btn btn-outline grey-salsa">返回</a>
			</div>
        </form>
    </div>
</div>
<script type="text/javascript">
	MyTouchSpin.init()
</script>